from datetime import datetime
import random


def pprint(content):
    print(f"[{datetime.now().strftime('%H:%M:%S')}] {content}")


def pinput(content):
    return input(f"[{datetime.now().strftime('%H:%M:%S')}] {content}")


pprint("你好，我是有点抽象的AI。请在>>>后输入你的问题。")
while True:
    question = pinput(">>> ")
    if question == "退出":
        pprint("再见！")
        break
    elif ('?' in question) or ('？' in question) or ('吗' in question):
        answer = question.replace("?", "").replace("？", "").replace("吗", "")
        pprint(answer)
    elif ('.' in question) or ('。' in question):
        mode = random.randint(0, 3)
        if mode == 0:
            pprint("嗯")
        elif mode == 1:
            pprint("哦")
        elif mode == 2:
            answer = question.replace("。", ", too.").replace(".", ", too.")
            pprint(answer)
        elif mode == 3:
            pprint("看来，" + question)
    elif question == "":
        pprint("你怎么不说话？")
    else:
        answer = question + ", too."
        pprint(answer)
